<template>
  <div
    class="list-item"
    @click="$router.push('/MovieDetails/' + item.id + '')"
  >
    <div class="list-item-left">
      <van-image :src="`http://10.36.4.254:8080` + item.poster" />
    </div>

    <div class="list-item-center">
      <div class="title">{{ item.name }}</div>
      <div class="actor">主演:{{ item.actor }}</div>
      <div>语言:{{ item.language }}</div>
      <div>时长:{{ item.movieLong }}</div>
    </div>

    <div class="list-item-right">
      <button type="button">详情</button>
    </div>
  </div>
</template>

<script>
export default {
props:['item'],
}
</script>

<style lang="scss" scoped>
  .list-item {
    display: flex;
    width: 100%;
    height: 33vw;
    background-color: #fff;
    border-radius: 0.3rem;
    &:not(:last-child) {
      margin-bottom: 0.5rem;
    }
    > .list-item-left {
      width: 23vw;
      overflow: hidden;
      border-radius: 0.3rem;
    }
    > .list-item-center {
      > .title {
        color: #1f1f1f;
        font-weight: 700;
      }
      display: flex;
      flex-flow: column nowrap;
      justify-content: space-evenly;
      width: 50vw;
      color: #858585;
      padding: 0 0.5rem;
      min-width: 0;
    }
    > .list-item-right {
      color: #fff;
      width: 25vw;
      display: flex;
      justify-content: center;
      align-items: center;
      > button {
        border: none;
        height: 1.7rem;
        line-height: 1.7rem;
        padding: 0 0.7rem;
        background-color: #79bd90;
        border-radius: 1.7rem;
      }
    }
  }
  .actor {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }
  </style>